package com.ypj.service.impl;

import com.ypj.dao.UserDao;
import com.ypj.dao.impl.UserDaoImpl;
import com.ypj.domain.User;
import com.ypj.service.UserService;

public class UserServiceImpl implements UserService {
    private UserDao userDao=new UserDaoImpl();
    @Override
    public User login(String userCode, String password) {
        User user=userDao.getLoginUser(userCode);
        if (!password.equals(user.getUserPassword())){
            user=null;
        }
        return user;
    }

    @Override
    public boolean updatePwd(int id,String pwd) {
        int num=userDao.updatePwd(id,pwd);
        return num>0;
    }
}
/*class A{
    //测试
    public static void main(String[] args) {
        UserServiceImpl service=new UserServiceImpl();
        boolean f=service.updatePwd(1,"1234567");

    }
}*/
